#ifndef QNBHEARTTHREAD_H
#define QNBHEARTTHREAD_H

#include <QObject>
#include <QTimer>

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>

#include "QNBConfig.h"

class QNBHeartThread:public QObject
{
    Q_OBJECT

public:
    QNBHeartThread();
    ~QNBHeartThread();

    void setTimer();


protected slots:
    void reqHeart();
    void reqUpdateConfig();

    void replyHeartFinished(QNetworkReply *reply);
    void reqError(QNetworkReply::NetworkError errorCode);

    void replyUpdateConfigFinished(QNetworkReply *reply);

    void userdataDelete();
private:
    void chakan(QString path, time_t deleteTime);

private:
    QTimer *m_heartTimer;
    QTimer *m_updateConfigTimer;
    QTimer *m_deleteUserDataTimer;

    QNetworkAccessManager *reqHeartNAM;
    QNetworkAccessManager *reqUpdateConfigNAM;
    QNetworkReply *reply;

    QNetworkReply *reply2;

};

#endif // QNBHEARTTHREAD_H
